﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.Generic;

namespace Nok_Air.NokObjects
{
    public class ScheduleItemViewModel : INotifyPropertyChanged
    {
        private DateTime _day;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public DateTime Day
        {
            get
            {
                return _day;
            }
            set
            {
                if (value != _day)
                {
                    _day = value;
                    NotifyPropertyChanged("Day");
                }
            }
        }

        private List<NokObjects.ScheduleItemResponse> _scheduleItem;
        public List<NokObjects.ScheduleItemResponse> ScheduleItem
        {
            get
            {
                return _scheduleItem;
            }
            set
            {
                if (value != _scheduleItem)
                {
                    _scheduleItem = value;
                     NotifyPropertyChanged("ScheduleItem");
                }
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }    
    }
    public class ScheduleItemResponse : INotifyPropertyChanged
    {

        /*<Flight> <Departure>HDY</Departure> <Arrival>DMK</Arrival> <DepartureTime>15:05</DepartureTime> <ArrivalTime>16:30</ArrivalTime> <FlightNumber>DD7111</FlightNumber> </Flight>*/
        private string _departure;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string Departure
        {
            get
            {
                return _departure;
            }
            set
            {
                if (value != _departure)
                {
                    _departure = value;
                    NotifyPropertyChanged("Departure");
                }
            }
        }


        private string _arrival;
        public string Arrival
        {
            get
            {
                return _arrival;
            }
            set
            {
                if (value != _arrival)
                {
                    _arrival = value;
                    NotifyPropertyChanged("Arrival");
                }
            }
        }

        private string _departureTime;
        public string DepartureTime
        {
            get
            {
                return _departureTime;
            }
            set
            {
                if (value != _departureTime)
                {
                    _departureTime = value;
                    NotifyPropertyChanged("DepartureTime");
                }
            }
        }

        private string _arrivalTime;
        public string ArrivalTime
        {
            get
            {
                return _arrivalTime;
            }
            set
            {
                if (value != _arrivalTime)
                {
                    _arrivalTime = value;
                    NotifyPropertyChanged("ArrivalTime");
                }
            }
        }

        public string Dep
        {
            get
            {
                return App.ViewModel.Dep;
            }
            set
            {
                if (value != App.ViewModel.Dep)
                {
                    App.ViewModel.Dep = value;
                    NotifyPropertyChanged("Dep");
                }
            }
        }
        public string Arr
        {
            get
            {
                return App.ViewModel.Arr;
            }
            set
            {
                if (value != App.ViewModel.Arr)
                {
                    App.ViewModel.Arr = value;
                    NotifyPropertyChanged("Arr");
                }
            }
        }

        private string _flightNumber;
        public string FlightNumber
        {
            get
            {
                return _flightNumber;
            }
            set
            {
                if (value != _flightNumber)
                {
                    _flightNumber = value;
                    NotifyPropertyChanged("FlightNumber");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}